package com.mitaotao._1_语法._3_分支._3_if判断;

import java.util.Scanner;

public class _03_根据输入x的值输出y_3 {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入x的值：");
        //当x<1,y=x;
        //当1<=x<10,y=2x-1;
        //当x>=10,y=3x-11;
        int x = scanner.nextInt();
        int y = 0;

        if (x < 1){
            y = x;
        }
        else {
            if (x>=1 && x<10){
                y = 2*x-1;
            }
            else {
                y = 3*x-11;
            }
        }
        System.out.println("y="+y);
        scanner.close();
    }
}

